package th.go.drr.gps.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="drrgpsdata")
public class GpsData implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="DRRGPSDATA_OBJECTID_GENERATOR", sequenceName="DRRGPSDATA_OBJECT_ID_SEQ",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="DRRGPSDATA_OBJECTID_GENERATOR")
	@Column(name="object_id")
	private Long objectId;

	private Amphur amphure;

	private String name;

	@Column(name="project_name")
	private String projectName;
	
	private Province province;

	@Column(name="rdroute_id")
	private Long rdrouteId;

	private float shape;
	
	private Tumbol tumbol;

    public GpsData() {
    }

	public Long getObjectId() {
		return this.objectId;
	}

	public void setObjectId(Long objectId) {
		this.objectId = objectId;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getProjectName() {
		return this.projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	public Long getRdrouteId() {
		return this.rdrouteId;
	}

	public void setRdrouteId(Long rdrouteId) {
		this.rdrouteId = rdrouteId;
	}

	public float getShape() {
		return this.shape;
	}

	public void setShape(float shape) {
		this.shape = shape;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name ="tumbol_id",insertable= false,updatable=false)
	public Tumbol getTumbol() {
		return tumbol;
	}

	public void setTumbol(Tumbol tumbol) {
		this.tumbol = tumbol;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "province_id",insertable= false,updatable=false)
	public Amphur getAmphure() {
		return amphure;
	}

	public void setAmphure(Amphur amphure) {
		this.amphure = amphure;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name ="province_id",insertable= false,updatable=false)
	public Province getProvince() {
		return province;
	}

	public void setProvince(Province province) {
		this.province = province;
	}

}